package com.gjy.design.single;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-06 09:59:06
 */
public class LazySingletonNotThreadSafe {

    private static LazySingletonNotThreadSafe instance;

    private LazySingletonNotThreadSafe() {
    }

    public static LazySingletonNotThreadSafe getInstance() {
        // 如果实例不存在，才创建
        if (instance == null) {
            instance = new LazySingletonNotThreadSafe();
        }
        return instance;
    }

    public void doSomething() {
        System.out.println("懒汉式(线程不安全)单例正在执行业务...");
    }

}
